<!doctype html>

<html>
  <head>
    <title></title>
    <meta charset="utf-8" />

    
    <script type="text/javascript">
			document.addEventListener("DOMContentLoaded", iniciaeventos, false); 
        function iniciaeventos() 	
	       { 
			   document.getElementById('canvas').addEventListener("keydown", onKeyDown, false); 
        } 
        function onKeyDown(e)
       { 
           alert(e.keyCode); 
       }
     

    </script>

  </head>
<body>
    <canvas id="canvas" width="640" height="360" tabindex="0"></canvas>
    <script>
         document.getElementById('canvas').focus();
    </script>
  </body>
</html>
